package com.guandeng.dubbo.factory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author guandeng.fan
 * @date 2022/5/11 10:41
 */
@Service
public class AnimalFactory {
    @Autowired
    private Dog dog;
    @Autowired
    private Cat cat;

    public Animal build(String type) {
        switch (type) {
            case "dog":
                return dog;
            case "cat":
                return cat;
            default:
                System.out.println("没有传参数");
        }
        return null;
    }
}


